API Documentation
Public Member Functions | List of all members
nkScripts::Namespace Class Referenceabstract

Holds information and allow control over a namespace in a scripting environment. More...

Public Member Functions

 Namespace (const nkMemory::StringView &name)
 
virtual ~Namespace ()
 
nkMemory::StringView getName () const
 
virtual NamespacegetNamespace (const nkMemory::StringView &name) const =0
 
virtual UserTypegetUserType (const nkMemory::StringView &name) const =0
 
virtual void setVar (const nkMemory::StringView &name, int value)=0
 
virtual void setObject (const nkMemory::StringView &name, const nkMemory::StringView &userTypeName, void *value)=0
 
virtual NamespacesetNamespace (const nkMemory::StringView &name)=0
 
virtual UserTypesetUserType (const nkMemory::StringView &name)=0
 
virtual FunctionsetFunc (const nkMemory::StringView &name)=0
 
virtual void shutdown ()=0
 
virtual void reset ()=0
 

Detailed Description

Holds information and allow control over a namespace in a scripting environment.

Constructor & Destructor Documentation

◆ Namespace()

nkScripts::Namespace::Namespace ( const nkMemory::StringView name)

Constructor.

Parameters
nameThe namespace name.

◆ ~Namespace()

virtual nkScripts::Namespace::~Namespace ( )
virtual

Destructor.

Member Function Documentation

◆ getName()

nkMemory::StringView nkScripts::Namespace::getName ( ) const
Returns
The namespace name.

◆ getNamespace()

virtual Namespace* nkScripts::Namespace::getNamespace ( const nkMemory::StringView name) const
pure virtual
Parameters
nameThe name of the sub namespace to retrieve.
Returns
The sub namespace if available, nullptr else.

◆ getUserType()

virtual UserType* nkScripts::Namespace::getUserType ( const nkMemory::StringView name) const
pure virtual
Parameters
nameThe name of the user type to retrieve.
Returns
The user type defined in the namespace if available, nullptr else.

◆ setVar()

virtual void nkScripts::Namespace::setVar ( const nkMemory::StringView name,
int  value 
)
pure virtual

Sets a variable within the namespace.

Parameters
nameThe name of the variable to set.
valueThe value it should have.

◆ setObject()

virtual void nkScripts::Namespace::setObject ( const nkMemory::StringView name,
const nkMemory::StringView userTypeName,
void *  value 
)
pure virtual

Sets an object within the namespace.

Parameters
nameThe name of the object to set.
userTypeNameThe user type name identifying the type of the object to set.
valueThe user data pointer to attach.

◆ setNamespace()

virtual Namespace* nkScripts::Namespace::setNamespace ( const nkMemory::StringView name)
pure virtual

Sets a sub namespace.

Parameters
nameThe name of the sub namespace to set.
Returns
The newly created namespace. External code does not own it, it should not delete it.

◆ setUserType()

virtual UserType* nkScripts::Namespace::setUserType ( const nkMemory::StringView name)
pure virtual

Sets a user type.

Parameters
nameThe name of the type to set.
Returns
The newly created user type. External code does not own it, it should not delete it.

◆ setFunc()

virtual Function* nkScripts::Namespace::setFunc ( const nkMemory::StringView name)
pure virtual

Sets a function.

Parameters
nameThe name of the sub namespace to set.
Returns
The newly created function. External code does not own it, it should not delete it.

◆ shutdown()

virtual void nkScripts::Namespace::shutdown ( )
pure virtual

Prepares the namespace for shutdown. In theory, should never be called by external code.

◆ reset()

virtual void nkScripts::Namespace::reset ( )
pure virtual

Resets the namespace, to free all sub namespaces, functions, user types set on it.


The documentation for this class was generated from the following file: